:root {
    --cell-font-size: 15px;
}

body {
    margin: 0;
    display: flex; /* 设置为flex容器 */
    justify-content: center; /* 水平居中 */
    font-family: 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif;
    background: #c8a15e;
}

.main {
    color: #6d2c11;
    display: flex;
    align-items: center;
    margin: 20px 60px;
    gap: 80px;
}

.main-inner {
    display: flex;
    flex-direction: column;
}

.game-header {
    font-size: 28px;
    font-weight: bold;
    width: calc(100% - 90px);
    padding: 8px;
    background-color: #a1452a;
    color: rgb(240, 233, 87);
    margin-bottom: 18px;
    border-radius: 2px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3), 0 4px 10px rgba(0, 0, 0, 0.2);
}

.header-btn {
    background: transparent;
    color: #f7e36d;
    font-size: 18px;
    font-weight: bold;
    border-radius: 4px;
    padding: 4px;
    margin: 0 12px;
    cursor: pointer;
    box-shadow: none;
    width: 8em;
}
.header-btn:hover {
    border-color: #fffbe9;
    color: #fffbe9;
}


.board-container {
    border-radius: 20px;
    padding: 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.board {
    display: grid;
    gap: 3px;
    background: #6e3c22;
    border: 12px #c3884b solid;
    padding: 3px;
    border-radius: 12px;
    max-width: 740px;
    max-height: 570px;
    overflow: auto;
}

.space {
    background: transparent;
    box-shadow: none;
    cursor: default;
}

tr {
    display: flex;
    gap: 3px;
}

td {
    display: flex;
    background: #f5d29a;
    cursor: pointer;
    width: 3.2em;
    height: 3.2em;
    border-radius: 4px;
    align-items: center;
    justify-content: center;
    font-size: var(--cell-font-size);
    font-weight: 600;
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.2);
}

td:not(.space):hover {
    background: #eabc6d;
}

.info-bar {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 18px;
    font-size: 1.2rem;
    color: white;
}

.settings-section {
    margin-top: 20px;
    margin-right: 40px;
    background: #f5e3c0;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(110, 60, 34, 0.08);
    padding: 18px 0 18px 0;
}

.settings {
    min-width: 230px;
    border-radius: 10px;
    padding: 18px 22px 34px;
    background: #fff7e2;
    box-shadow: 0 2px 8px rgba(200, 129, 94, 0.08);
    border: 1px solid #e0c08a;
}

.settings h2 {
    font-size: 1.3rem;
    color: #7a4a1e;
    margin-bottom: 12px;
}

.setting-item {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.setting-item label {
    font-size: 1rem;
    color: #a97a3a;
}

.setting-item input[type="number"],
.setting-item select {
    background: #fffbe9;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #e0c08a;
    font-size: 1rem;
    color: #7a4a1e;
    transition: border 0.2s, box-shadow 0.2s;
}

.setting-item input[type="number"]:focus,
.setting-item select:focus {
    outline: none;
    border-color: #c3884b;
    box-shadow: 0 0 0 2px rgba(200, 129, 94, 0.13);
}

.setting-item option {
    color: #7a4a1e;
    background: #fffbe9;
}

.btn {
    width: 100%;
    padding: 10px 0;
    margin-top: 10px;
    background: linear-gradient(0deg, #c3884b 0%, #d6b681 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 3px 6px #555;
    transition: background 0.2s;
}

.btn:hover {
    background: linear-gradient(0deg, #b07a3a 0%, #ba8042 100%);
}

.playback-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.control-btn {
    background-color: transparent;
    border: 2px solid #a0a0a0;
    color: #a0a0a0;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    transition: all 0.2s ease-in-out;
}

.control-btn:hover {
    border-color: #418eff;
    color: #418eff;
    transform: scale(1.05);
}

.control-btn svg {
    width: 20px;
    height: 20px;
}

#btn-play {
    width: 52px;
    height: 52px;
}

#btn-play svg {
    width: 24px;
    height: 24px;
    transform: translateX(2px);
}

/* 媒体查询：移动端设备 */
@media (max-width: 990px) {
    .main {
        flex-direction: column;
        margin: 10px 4vw;
        gap: 24px;
        align-items: center;
        justify-content: center;
    }

    .board-container {
        padding: 12px;
        align-items: center;
        width: 100%;
    }

    .settings-section {
        margin: 0 auto;
        display: flex;
        justify-content: center;
    }

    .settings {
        border-radius: 8px;
        margin: 0;
        min-width: 280px;
    }

    .board {
        max-width: 85vw;
        max-height: 160vw;
        padding: 4px;
        gap: 4px;
        border-radius: 8px;
    }

    tr {
        gap: 4px;
    }

    td {
        font-size: calc(var(--cell-font-size) * 0.68);
    }

    .info-bar {
        gap: 12px;
        font-size: 1rem;
        margin-top: 10px;
    }

    .settings h2 {
        font-size: 1.1rem;
    }

    .setting-item label {
        font-size: 0.95rem;
    }

    .setting-item input[type="number"],
    .setting-item select {
        padding: 7px 8px;
        font-size: 0.95rem;
    }

    .btn {
        font-size: 1rem;
        padding: 8px 0;
        border-radius: 6px;
    }

    .playback-controls {
        gap: 8px;
        margin-top: 10px;
        padding-top: 10px;
    }

    .control-btn {
        width: 36px;
        height: 36px;
        border-radius: 50%;
    }

    .control-btn svg {
        width: 16px;
        height: 16px;
    }

    #btn-play {
        width: 42px;
        height: 42px;
    }

    #btn-play svg {
        width: 20px;
        height: 20px;
    }
}
